//
//  StatusBottom.swift
//  波波微博
//
//  Created by wave on 15/8/2.
//  Copyright © 2015年 wave. All rights reserved.
//

import UIKit

class StatusBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
  
        setupUI()

    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
  
    private func setupUI(){
    
        backgroundColor = UIColor(white: 0.95, alpha: 1.0)
        
        addSubview(forwardBtn)
        addSubview(commentBtn)
        addSubview(likeBtn)
        
        //设置自动布局
        ff_HorizontalTile([forwardBtn,commentBtn,likeBtn], insets: UIEdgeInsetsZero)
        
        //注册点击事件
        forwardBtn.addTarget(self, action: "clickForwardBtn", forControlEvents: UIControlEvents.TouchUpInside)
        commentBtn.addTarget(self, action: "clickCommentBtn", forControlEvents: UIControlEvents.TouchUpInside)
        likeBtn.addTarget(self, action: "clickLikeBtn", forControlEvents: UIControlEvents.TouchUpInside)

    }
    
    //点击转发
    func clickForwardBtn(){
    
        print("转发")
    }
    //点击评论
    func clickCommentBtn(){
        
        print("评论")
    }
    //点击赞
    func clickLikeBtn(){
        
        print("赞")
    }
    
    //MARK: - 懒加载控件
    private lazy var forwardBtn: UIButton = UIButton(title: "转发", imageName: "timeline_icon_retweet")
    private lazy var commentBtn: UIButton = UIButton(title: "评论", imageName: "timeline_icon_comment")
    private lazy var likeBtn: UIButton = UIButton(title: "赞", imageName: "timeline_icon_unlike")
    
}
